﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace 站点地图设计_面包屑.Models
{
    public class BannerModel
    {
        /// <summary>
        /// ID
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// 上级父ID
        /// </summary>
        public int ParentID { get; set; }
        /// <summary>
        /// 显示标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 是否处于显示状态
        /// </summary>
        public bool IsDisplay { get; set; }
        /// <summary>
        /// 控制器名称，如Home
        /// </summary>
        public string ControllerName { get; set; }
        /// <summary>
        /// action名称，如Index
        /// </summary>
        public string ActionName { get; set; }
        /// <summary>
        /// 路由数据，格式如new {grade=1,category=2,subject=15}
        /// </summary>
        public object RouteData { get; set; }

        public BannerModel()
        {

        }

        public BannerModel(int id, int partentID, string title, string controller, string action, object routeData)
        {
            ID = id;
            ParentID = partentID;
            Title = title;
            ControllerName = controller;
            ActionName = action;
            RouteData = routeData;
            IsDisplay = true;
        }
        public static List<BannerModel> DataInit()
        {
            List<BannerModel> data = new List<BannerModel>();
            data.Add(new BannerModel(1, 0, "网站首页", "Home", "Index", null));
            data.Add(new BannerModel(2, 1, "用户中心", "UserCenter", "Index", new { id = 1, page = 1 }));
            data.Add(new BannerModel(2, 1, "VIP中心", "UserCenter", "Index", new { id = 2, page = 1 }));
            return data;
        }
    }
}